UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zMPHxA9cTsE5zYwjX1/V6zF8gryG53ZwmlLxqEo117w='
WHERE
key_id = '3dc223c82fd157988cd6efa779c74bc910f4f1c47086dc9307fe5dd4678603e3'
AND (
token = 'zMPHxA9cTsE5zYwjX1/V6zF8gryG53ZwmlLxqEo117w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)