UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1IqFr2Ok20MvIGATeTwUOEjyZep4TbfMWnTH5BjkX2E='
WHERE
key_id = '835fa9013908ab6dd4599ec7f9fa802cee985b487c1c98efb31c829c687ed734'
AND (
token = '1IqFr2Ok20MvIGATeTwUOEjyZep4TbfMWnTH5BjkX2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)