UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MselYzec0nUxTZaMYiThg4J3VwLR+KI09VPWTVjzah4='
WHERE
key_id = '96364c00d8bd221da08a415c0dbbf1a63cc928b86f0f585bb9eefed8ae89c40b'
AND (
token = 'MselYzec0nUxTZaMYiThg4J3VwLR+KI09VPWTVjzah4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)