UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Nzo6iqsDW/BFh8CsCAwdJJMhFZzTeP78g7R6+nuAgE='
WHERE
key_id = '1aa4a4502d1ec2cb17e2228363b748a86881ec18c02c4909a580f3c7bc8f7c2e'
AND (
token = '9Nzo6iqsDW/BFh8CsCAwdJJMhFZzTeP78g7R6+nuAgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)