UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MLxFXPhUYF4yIVjFkQWAxun+kwz89/aurb6Xzb2KOTU=' 
WHERE 
  key_id = 'd2e4fb1ceecf1e3492a61f9ca4bb8df4bdee156ac9e0791e6730fb7c897ff76d' 
  AND (
    token = 'MLxFXPhUYF4yIVjFkQWAxun+kwz89/aurb6Xzb2KOTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030