This paper focuses on lock and quay co-scheduling problem (LQCP) so that delay time of ships at a lock and time spent at the quay are minimized. The task can be regarded as a main problem where an alternative mode for a ship is determined by solving two sub-problems of lock scheduling and berth allocation. For the first time, the LQCP considers the discrete berth allocation of container ships and the mooring constraints of lock scheduling. A mixed integer linear programming (MILP) model is formulated for the LQCP and small-scale problems are solved by branch and bound method. In addition, fuzzy logic control based heuristic method is proposed to handle large-scale LQCP. Specifically, a fuzzy-controlled quantum inspired gravitational search algorithm is proposed to search optimal mode combinations for the main problem iteratively. In each iteration, Tabu search based multi-order best fit algorithm is proposed to solve lock scheduling sub-problem and an adaptive large neighborhood search algorithm is applied to solve berth allocation sub-problem. The MILP and heuristic methods are tested on 42 instances, in which the MILP is implemented in Gurobi 7.5.1. Experimental results indicate that the MILP model can handle different traffic situations. The proposed heuristic method shows tiny optimality gap for small-scale instances and outperforms Gurobi on most of medium-large scale instances with respect to solution quality and computation time. Furthermore, comparison between different heuristics on medium and large scale instances confirms that the fuzzy logic control based heuristic outperforms other heuristic methods.