UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6wIQlFC356GhlFQwKPaYyoJ3x6iMj3cxZiwwzgYlyGc='
WHERE
key_id = 'e76b83a53770912a42f78f415760b214a4d65c67af90345e06a88cd917614e9b'
AND (
token = '6wIQlFC356GhlFQwKPaYyoJ3x6iMj3cxZiwwzgYlyGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)