UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GW5iKukP+IZGzGdEyFUSDawc/HsOdbzS1omhBBjBdHw='
WHERE
key_id = '32e8f71bf1e783184bfd16d741fe5e19298100e3e05d8029bf05aedd5686d82b'
AND (
token = 'GW5iKukP+IZGzGdEyFUSDawc/HsOdbzS1omhBBjBdHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)