UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y2Jj3uKyM/e/2xWpk3Jqwry6ADBrq9ChinfDvxUyMwc='
WHERE
key_id = 'fd42034d3903a972f16b567133c0b9af4d7797f0c9a62f1d4b58c2dc995a633c'
AND (
token = 'Y2Jj3uKyM/e/2xWpk3Jqwry6ADBrq9ChinfDvxUyMwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)