UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7ps45qWaLA/qnXIYkPC0QRezm8k3NKlVFNWxreYNeM='
WHERE
key_id = '8885368f765027b79823540a531798a49fe1533b0c4eefdbd6b7f14b4ee11148'
AND (
token = 'Q7ps45qWaLA/qnXIYkPC0QRezm8k3NKlVFNWxreYNeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)