UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '18ZYjV2Pdg4s4g62XM+KzUhMP8g+o6qceNQ75psYrxY='
WHERE
key_id = '1ce8f266ada84001b882aa1dc13020055c22f22c2ddf7dbf88818a05fecd8fdc'
AND (
token = '18ZYjV2Pdg4s4g62XM+KzUhMP8g+o6qceNQ75psYrxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)