UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZwZvBlEyNKP4n0Zagvomq1ENFQsMC3WueU30jpLWmoc='
WHERE
key_id = '653ee753f33d72128a7fab050746f857c4bc7c3254949b2f2012b6d94017be2c'
AND (
token = 'ZwZvBlEyNKP4n0Zagvomq1ENFQsMC3WueU30jpLWmoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)