UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kke6DpewYn9sDfH9iDunMvYHgd5Vifgr8aBveR50OE='
WHERE
key_id = 'bc17ae4cebdcd1a1db0847373380b35e5c94b80e74b0314736b8c9caacf61673'
AND (
token = '1kke6DpewYn9sDfH9iDunMvYHgd5Vifgr8aBveR50OE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)