UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4xwBYRAqTE0R1Vmj3BVZvBiSSObmpx97EtZKtKZDqhE='
WHERE
key_id = '562569ecaee37fe3efbce6f88fc1a5d9378b7f7bb3251a7df0edcd295dd915ca'
AND (
token = '4xwBYRAqTE0R1Vmj3BVZvBiSSObmpx97EtZKtKZDqhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)