UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZN82aLCibkFUXtswyTT/UnZgK8DJJmG47t6lM80NB0A=' 
WHERE 
  key_id = '4ba8058703a69ba68c806fd0d56a14ec0651263afe584bcb6d420410231d75b8' 
  AND (
    token = 'ZN82aLCibkFUXtswyTT/UnZgK8DJJmG47t6lM80NB0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020