UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uqBGmjra8S7TcaQNsTPxfEGQMuhYEbc/93dSG6syyyg=' 
WHERE 
  key_id = '8efa41cf880b0062acd114a16d4edce3309e02b14e13542bc295febc2df16e78' 
  AND (
    token = 'uqBGmjra8S7TcaQNsTPxfEGQMuhYEbc/93dSG6syyyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033