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

Query time 0.00020