UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oW+NEc4ooIPxuR4e59+jJslplrHhZZTyemh9vjhOtIE=' 
WHERE 
  key_id = '0e17a4039c7fe27b92b21634042f6deed29a00b7717e5691fce61735ea3c0fcf' 
  AND (
    token = 'oW+NEc4ooIPxuR4e59+jJslplrHhZZTyemh9vjhOtIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035