UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O7zmoMJeaha7J/eIWeu78gSyd6xdJ1td4PqlrsRPO+I=' 
WHERE 
  key_id = 'adf208c028561847f0cc88fceed5a6b433595a086d4ddd63d55c494b4d25c91f' 
  AND (
    token = 'O7zmoMJeaha7J/eIWeu78gSyd6xdJ1td4PqlrsRPO+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032