UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k59LlU+ZnVbGMf1BZZvEuvBY7viEbd+254+rtAtiamM=' 
WHERE 
  key_id = 'a860e4030bed1c07daf09925383217213d7f86c08ea2e828410c3c36fb1eb844' 
  AND (
    token = 'k59LlU+ZnVbGMf1BZZvEuvBY7viEbd+254+rtAtiamM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030