UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'txZqInDYFRpgjbREbdYqDLyQqSL6VpB4vQ9uRBJJhPY='
WHERE
key_id = 'd30b5549bf3032cf8570abf4131c958aef4d707ae8c2c3560ea7a24e0d8e37f2'
AND (
token = 'txZqInDYFRpgjbREbdYqDLyQqSL6VpB4vQ9uRBJJhPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)