UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aunht7rRkcdr6eJfsfVXZQgwIDl/MUcnJm4HQ+11Usc='
WHERE
key_id = '39e7a0b0b2f833100f69b30ec634db2bbd70be7dd427321b09ef7e3329315233'
AND (
token = 'aunht7rRkcdr6eJfsfVXZQgwIDl/MUcnJm4HQ+11Usc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)