UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0BOgqiVQVQhZyHKF/3xcsc++ubedy2RV1ZwmtSPTP4s=' 
WHERE 
  key_id = '835061020c457d988b77ae7a63b4b7a50bb42741c63b41f568f8ccf8a609aff1' 
  AND (
    token = '0BOgqiVQVQhZyHKF/3xcsc++ubedy2RV1ZwmtSPTP4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024