UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RwfZ8bfjduzbOYzZYQ1hnZnxnFPw/wVD5CXEBFasXBI='
WHERE
key_id = '9f2e1e60f441afe6c81514d3f7029fadff3b259c28a340877593b6e76f7aef8c'
AND (
token = 'RwfZ8bfjduzbOYzZYQ1hnZnxnFPw/wVD5CXEBFasXBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)