UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h0BYrjJb/PdluCWMJiBpHUS5T6gvIvk8JX8K78EAgGw='
WHERE
key_id = '176247c96111d7ab3d78bb19e68f55101cb3fbf50b62cb1c9753c9b0b4346f4d'
AND (
token = 'h0BYrjJb/PdluCWMJiBpHUS5T6gvIvk8JX8K78EAgGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)