UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJmiCKwrttL4jzV84y9wgHzrKvRIYDDFwMXkir125Vc='
WHERE
key_id = 'fcbc8620fac4500809ea32d6e0c807101acaf5e56325f24b487c2c2acc17ce6a'
AND (
token = 'tJmiCKwrttL4jzV84y9wgHzrKvRIYDDFwMXkir125Vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)