UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IvyVDSyGJBInL4DL0V66JpUK75aGqqy2zGxSBYjcFSk='
WHERE
key_id = '2db44c49b1e60cbd8251ab0c39482c1637b23d3e3c59d8e9b09666fb82c83696'
AND (
token = 'IvyVDSyGJBInL4DL0V66JpUK75aGqqy2zGxSBYjcFSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)