UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Es8DrkXyBdEhMA5/tkj6jES1o45NHh7A8vIEkh4pgGY='
WHERE
key_id = 'a392d00a1a3c65dc2964c41043b3cf1e2c47056c98150d0f01532eca5caaf734'
AND (
token = 'Es8DrkXyBdEhMA5/tkj6jES1o45NHh7A8vIEkh4pgGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)