UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gq7bQFHSSJSWlyrluO+x0SJENMFLljrq6qywz6oBTkc=' 
WHERE 
  key_id = 'daf441234cc13c253ced5e8b88c2e42392b20027138779c2f25de8db147514e3' 
  AND (
    token = 'Gq7bQFHSSJSWlyrluO+x0SJENMFLljrq6qywz6oBTkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066