UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VPiRImLZpE+TMffruUWkV32HPnutvuFIOwe+BOPaXQk='
WHERE
key_id = 'b68f1b61d798983c0ac9e47e15db92d79e384d43c6ef6ffd7ae448c194a42f13'
AND (
token = 'VPiRImLZpE+TMffruUWkV32HPnutvuFIOwe+BOPaXQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)