UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Mz7Fb9r3qPDbpIcY7kJZ5tM3TXDpk1VJqUZuWzScyo='
WHERE
key_id = '22e8576e9c03a0603563114f384cab87ac3846d948dab361560de863c11f3cb6'
AND (
token = '2Mz7Fb9r3qPDbpIcY7kJZ5tM3TXDpk1VJqUZuWzScyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)