UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XyWXMPqRisVc6q1X22y9UbD6b9QspYyIet2k5EWbLHY='
WHERE
key_id = '140377d676952d20accf94b6be1cec64f2e0257a6b3288090aaf6a15cec37a37'
AND (
token = 'XyWXMPqRisVc6q1X22y9UbD6b9QspYyIet2k5EWbLHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)