UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ORjwEQ/jC6DOwF3CmQkFbYP7jkNjc3VEXMa5TjIYvCw='
WHERE
key_id = '05ae6bbf0e1c7f1f9a1433992691f3f03a3dc38833e01d80e53a7681904e22bd'
AND (
token = 'ORjwEQ/jC6DOwF3CmQkFbYP7jkNjc3VEXMa5TjIYvCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)