UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bkjxP4t30qhPl+gLz7t4h9nqB+HCgnuyq9zTQcrqSuU=' 
WHERE 
  key_id = '9c7191b4cbc0958ead7763ce6200f404264f30c5966a3e7b1460c6bb0c8f69c3' 
  AND (
    token = 'bkjxP4t30qhPl+gLz7t4h9nqB+HCgnuyq9zTQcrqSuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030