UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mjM6vBizA40EjeTckb33SPr4At+p54EXzwh0/0fZDY0='
WHERE
key_id = '3cbbb4ed08b87ebff6381659cebb1368293b9b58767d0fcdb795e47e0cdbad0e'
AND (
token = 'mjM6vBizA40EjeTckb33SPr4At+p54EXzwh0/0fZDY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)