UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eJZjDxV2cmMNDnwBMQgcpSPWYpvM+vKodwp/GeicIS8='
WHERE
key_id = '9cfc44c6eb9a9b5073fae699a83a6aa294d7fa0bc3db0f1000a7337818d8d385'
AND (
token = 'eJZjDxV2cmMNDnwBMQgcpSPWYpvM+vKodwp/GeicIS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)