UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sexUMPWW4pw6uicOD8ewtJ3wBWK/4YeT8QZthd5U3AE=' 
WHERE 
  key_id = '5214d89fa04e7ca08b5549b95a1614c70648da4ed895717e77f91158dfb3a39b' 
  AND (
    token = 'sexUMPWW4pw6uicOD8ewtJ3wBWK/4YeT8QZthd5U3AE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033