UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W32MH7Ebu2VxhVBByroLZh3wYqpBOrsNLkrm5DefTvM=' 
WHERE 
  key_id = 'e8567a3b53af6920dc2a732a1d4d5bc1bab91d599a21b1eeea1cc8c94598cfc3' 
  AND (
    token = 'W32MH7Ebu2VxhVBByroLZh3wYqpBOrsNLkrm5DefTvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025